package org.com.myfb.action;

import org.com.myfb.service.StudentsServiceInter;

import com.opensymphony.xwork2.ActionSupport;

public class QueryStudentByNameAction extends ActionSupport  {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String data;
	private String name;
	private StudentsServiceInter StudentsServiceImpl;
	public String getData() {
		return data;
	}
	public void setData(String data) {
		this.data = data;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public StudentsServiceInter getStudentsServiceImpl() {
		return StudentsServiceImpl;
	}
	public void setStudentsServiceImpl(StudentsServiceInter studentsServiceImpl) {
		StudentsServiceImpl = studentsServiceImpl;
	}
	
	public String execute(){
		String where = " state = 1 and name like " + "'%" + this.getName() + "%'";
		this.setData(this.getStudentsServiceImpl().queryStudentByName(where));
		return SUCCESS;
	}
	
}
